package ch8.TuXing;

public class Circle extends Tuxing {
    static final double pi=3.14;
    private double r;

    public Circle(String name,double r) {
        super(name);
        this.r = r;
    }

    @Override
    public double area() {
        return pi*r*r;
    }

    @Override
    public double perimeter() {
        return 2*pi*r;
    }

    public double getR() {
        return r;
    }

    public void setR(double r) {
        this.r = r;
    }
}
